{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "# Management of Computer virus threats\n", "## Problem definition\n", "The IT department of your company has detected a threat in a software virus that affects the Operating System (OS) of the PCs used in the company. When the virus infects a computer, it sends emails to a set of corporate emails. Once the virus is installed in a computer, there is a procedure that can successfully remove the virus and restore the normal operation of the computer. However, in some situations, IT might not be able to restore the OS and the computer might become non-operative.\n", "\n", "IT wants to use Markov Chains to model the status of a computer. After collecting data, they have determined that the probability that a computer is infected by the virus given that it was operating normally the day before is 0.05. The probability that the computer is non-operative for other reasons given that it was operating normally the day before is 0.1. Once a computer is infected, they always perform the virus removal procedure in the same day. They estimate that the probability that the procedure is successful is 70%, while in 30% of the cases the procedure renders the computer non-operative. When a computer is in non-operative state, the equipment supplier always replaces it the next business day.\n", "\n", "**a** Define the one-step probability matrix of the Markov chain\n", "Let us identify the following states of a computer: \n", "\n", "$s_1: \\text{The computer is in normal operation}$\n", "\n", "$s_2: \\text{The computer is infected by the virus}$\n", "\n", "$s_3: \\text{The computer is non-operative for any other reason}$\n", "\n", "Given this states, the one-step transition probability matrix can be expressed as:\n", "\n", "$P^{(1)}=\\begin{bmatrix}\n", "0.85 & 0.05 & 0.1\\\\\n", "0.7 & 0 & 0.3\\\\ \n", "1 & 0 & 0\\end{bmatrix}$\n", "\n", "Note that in the matrix the value of $p_{ij}$ is the probability that a computer is in state $j$ in the next day given that it is in state $i$. Since the provider always replaces the computer the next day, $p_{31} = 1$.\n", "\n", "**b** The maintenance cost of a computer is 3€/day when it operates normally. The cost of the virus removal procedure is 30€ and the cost of replacing a computer is 1200€. Calculate the long term average costs in computer maintenance for the IT department. \n", "\n", "Let us first define the system of equations to obtain the long term probabilities of the Markov system:\n", "\n", "$\\pi_1 = 0.85*\\pi_1 + 0.7*\\pi_2 + \\pi_3$\n", "\n", "$\\pi_2 = 0.05*\\pi_1$\n", "\n", "$\\pi_3 = 0.1*\\pi_1+0.3*\\pi_2$\n", "\n", "$\\pi_1+\\pi_2+\\pi_3=1$\n", "\n", "With this, we can calculate: \n", "\n", "$\\pi_1 = \\frac{1}{1+0.05+0.115}=0,858$\n", "\n", "$\\pi_2 = 0.05*\\pi_1 = 0,0429$\n", "\n", "$\\pi_3 = 0.015*\\pi_1 = 0,0987$\n", "\n", "And once that the values of the long term probabilities are obtained, long term costs are calculated as: \n", "\n", "$C= 3*\\pi_1+30*\\pi_2+1200*\\pi_3$\n", "\n", "$C = 122.3€$\n", "\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" }, "pycharm": { "stem_cell": { "cell_type": "raw", "source": [], "metadata": { "collapsed": false } } } }, "nbformat": 4, "nbformat_minor": 0 }